package com.twu.biblioteca;


import java.util.ArrayList;

public class Book implements RentableObject{
    private String id;
    private String title,author;
    private int yearPublished;
    private boolean checkedOut;
    
    Book(String id, String title, String author, int yearPublished){
        this.id = id;
        this.title=title;
        this.author=author;
        this.yearPublished=yearPublished;
        checkedOut=false;
    }

    public String getId() {
        return this.id;
    }

    public String getTitle() {
        return title;
    }

    String getAuthor(){
        return author;
    }

    int getYearPublished(){
        return yearPublished;
    }

    public boolean getCheckedOut(){
        return checkedOut;
    }

    @Override
    public String toString() {
        return this.getDetails();
    }

    @Override
    public void markCheckedOut() {
        this.checkedOut = !checkedOut;
    }

    @Override
    public String getDetails() {
        return String.format("%-20s%-50s%-50s%-20s",this.id, this.title, this.author, String.valueOf(this.yearPublished));
    }

}
